<?php
  
// Datenbank initiieren
$db = new Database('SMT-ADMIN');
$url = base::get('url');
$server = new Server;
$user = Base::get('Handler')->user;
$ticket = new Ticket;
$file = new File;
$time = new Time();
$ses  = Session::getInstance();

if (in_array('download', $url)) {
  $file->downloadFile(end($url));
}

// Standardabfragen ins Template übergeben
template::setText('submenu_content', Base::get('Handler')->loadMenu(Base::get('controller'), Base::get('methode')));
template::setText('news_content', Base::get('Handler')->loadNews(Base::get('controller')));
template::setText('ticket_prio', base::get('Handler')->config['ticket_prio']);
template::setText('ticket_status', base::get('Handler')->config['ticket_status']);
template::setText('erledigt', array('0','10','20','30','40','50','60','70','80','90','100'));

// Bei NEU oder EDIT Server und Userdaten ins Template übergeben
if (in_array('new', $url) || in_array('edit', $url)) {
  template::setText('user_liste', $user->listUsers());
  template::setText('server_liste', $server->getAllSystem(False, False));
}

require_once base::getSubcontroller();

?>

